#include "stdafx.h"
#include "PropertyPageFactory.h"
#include "PropertyTemplateId.h"
#include "PropertyTemplate.h"

#include "AbilityPropertyPage.h"
#include "CareerPropertyPage.h"
#include "AttackAttributePropertyPage.h"
#include "AttackStatusPropertyPage.h"
#include "AttackMonsterPropertyPage.h"
#include "MpAbsorbPropertyPage.h"
#include "AttackRangePropertyPage.h"
#include "DoubleAttackPropertyPage.h"
#include "HpAbsorbPropertyPage.h"
#include "FirstAttackPropertyPage.h"
#include "StaticDamagePropertyPage.h"
#include "UnblockablePropertyPage.h"
#include "LowChargePropertyPage.h"
#include "DefenceAttributePropertyPage.h"
#include "DefenceStatusPropertyPage.h"
#include "RecoverWalkPropertyPage.h"
#include "RecoverBattlePropertyPage.h"
#include "ReflectPropertyPage.h"
#include "AbsorbMagicPropertyPage.h"
#include "MoreExpPropertyPage.h"
#include "SafeWalkPropertyPage.h"
#include "StolePropertyPage.h"
#include "IgnoreGenderPropertyPage.h"
#include "HealPropertyPage.h"
#include "HealAllPropertyPage.h"
#include "RemoveStatusPropertyPage.h"
#include "RevivePropertyPage.h"
#include "UseInBattlePropertyPage.h"
#include "BuyPropertyPage.h"
#include "PickPropertyPage.h"
#include "DropPropertyPage.h"

#ifdef WIN32
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#endif

namespace serika
{
	namespace dq
	{
		PropertyPageFactory::PropertyPageFactory()
		{
		}

		PropertyPageFactory::~PropertyPageFactory()
		{
		}

		// static
		PropertyPage* PropertyPageFactory::CreatePage(PropertyTemplate* tmpl)
		{
			int tmplId = tmpl->GetId();
			switch (tmplId)
			{
			case PropertyTemplateId::Ability: return new AbilityPropertyPage(tmpl);
			case PropertyTemplateId::Career: return new CareerPropertyPage(tmpl);
			case PropertyTemplateId::AttackAttribute: return new AttackAttributePropertyPage(tmpl);
			case PropertyTemplateId::AttackStatus: return new AttackStatusPropertyPage(tmpl);
			case PropertyTemplateId::AttackMonster: return new AttackMonsterPropertyPage(tmpl);
			case PropertyTemplateId::MpAbsorb: return new MpAbsorbPropertyPage(tmpl);
			case PropertyTemplateId::AttackRange: return new AttackRangePropertyPage(tmpl);
			case PropertyTemplateId::DoubleAttack: return new DoubleAttackPropertyPage(tmpl);
			case PropertyTemplateId::HpAbsorb: return new HpAbsorbPropertyPage(tmpl);
			case PropertyTemplateId::FirstAttack: return new FirstAttackPropertyPage(tmpl);
			case PropertyTemplateId::StaticDamage: return new StaticDamagePropertyPage(tmpl);
			case PropertyTemplateId::Unblockable: return new UnblockablePropertyPage(tmpl);
			case PropertyTemplateId::LowCharge: return new LowChargePropertyPage(tmpl);
			case PropertyTemplateId::DefenceAttribute: return new DefenceAttributePropertyPage(tmpl);
			case PropertyTemplateId::DefenceStatus: return new DefenceStatusPropertyPage(tmpl);
			case PropertyTemplateId::RecoverWalk: return new RecoverWalkPropertyPage(tmpl);
			case PropertyTemplateId::RecoverBattle: return new RecoverBattlePropertyPage(tmpl);
			case PropertyTemplateId::Reflect: return new ReflectPropertyPage(tmpl);
			case PropertyTemplateId::AbsorbMagic: return new AbsorbMagicPropertyPage(tmpl);
			case PropertyTemplateId::MoreExp: return new MoreExpPropertyPage(tmpl);
			case PropertyTemplateId::SafeWalk: return new SafeWalkPropertyPage(tmpl);
			case PropertyTemplateId::Stole: return new StolePropertyPage(tmpl);
			case PropertyTemplateId::IgnoreGender: return new IgnoreGenderPropertyPage(tmpl);
			case PropertyTemplateId::Heal: return new HealPropertyPage(tmpl);
			case PropertyTemplateId::HealAll: return new HealAllPropertyPage(tmpl);
			case PropertyTemplateId::RemoveStatus: return new RemoveStatusPropertyPage(tmpl);
			case PropertyTemplateId::Revive: return new RevivePropertyPage(tmpl);
			case PropertyTemplateId::UseInBattle: return new UseInBattlePropertyPage(tmpl);
			case PropertyTemplateId::Buy: return new BuyPropertyPage(tmpl);
			case PropertyTemplateId::Pick: return new PickPropertyPage(tmpl);
			case PropertyTemplateId::Drop: return new DropPropertyPage(tmpl);

			default:
				return 0;
			}
		}
	}
}

